package io.wit.modules.wit.service.impl;

import io.wit.modules.wit.dao.DynamicDao;
import io.wit.modules.wit.entity.DynamicEntity;
import io.wit.modules.wit.service.DynamicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Service("dynamicService")
public class DynamicServiceImpl implements DynamicService {
	@Autowired
	private DynamicDao dynamicDao;
	
	@Override
	public DynamicEntity queryObject(Long dataId){
		return dynamicDao.queryObject(dataId);
	}
	
	@Override
	public List<DynamicEntity> queryList(Map<String, Object> map){
		return dynamicDao.queryList(map);
	}
	
	@Override
	public int queryTotal(Map<String, Object> map){
		return dynamicDao.queryTotal(map);
	}
	
	@Override
	public void save(DynamicEntity dynamic){
		dynamic.setCreateTime(new Date());
		dynamicDao.save(dynamic);
	}
	
	@Override
	public void update(DynamicEntity dynamic){
		dynamicDao.update(dynamic);
	}
	
	@Override
	public void delete(Long dataId){
		dynamicDao.delete(dataId);
	}
	
	@Override
	public void deleteBatch(Long[] dataIds){
		dynamicDao.deleteBatch(dataIds);
	}
	
}
